<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button onclick="call()" value="点击获取设备信息">点击获取信息 </button>
<ul>
    <li id="mi">距离：</li>

</ul>
</body>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript" charset="utf-8"></script>
<script>
    wx.config({!! $js->config(array('onMenuShareQQ', 'onMenuShareWeibo','hideOptionMenu','startSearchBeacons','onSearchBeacons','stopSearchBeancons','getLocation'), true) !!});
    wx.ready(function(){
        wx.startSearchBeacons({
            ticket: "",
            complete: function (argv) {
                wx.onSearchBeacons({
                    complete:function(argv){
                        alert(JSON.stringify(argv.beacons[0]));
                        //回调函数


                    }
                });
            }
        });
    })

    wx.error(function(res){alert(res);
    });





  /*
    wx.startSearchBeacons({
        ticket:"",  //摇周边的业务ticket, 系统自动添加在摇出来的页面链接后面
        complete:function(argv){
//开启查找完成后的回调函数
        }
    });*/
</script>
</html>